﻿using QQExpression.Currency;
using QQExpression.Utils.Currency;
using QQExpression.Utils.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QQExpression
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            FloderHelper.InitFloder();
        }

   
        private void button1_Click(object sender, EventArgs e)
        {
            StartReadAsync();
        }

        private async Task StartReadAsync()
        {
            String FloderPath = await new Utils.QQhelper().ReadFileAsync(FileHelper.SelectFile(), richTextBox1);

            if (FloderPath != "")
            {
                richTextBox1.AppendText("\r\n提取完毕，保存路径：" + FloderPath);

                richTextBox1.Select(richTextBox1.TextLength, 0);//光标定位到文本最后
                richTextBox1.ScrollToCaret();
                if (MessageHelper.DialogResultAlert("清理缩略图？"))
                    new Utils.ImageHelper().DeleteLittleImageFloder(FloderPath,53,53);
                    if (MessageHelper.DialogResultAlert("打开文件夹？"))
                    FloderHelper.OpenFloder(FloderPath);
            }
        }



        private void button2_Click(object sender, EventArgs e)
        {
            FloderHelper.OpenFloder(StaticValue.TempPath);
        }

        private void label2_Click(object sender, EventArgs e)
        {
            FloderHelper.OpenFloder("http:\\acg12.net");
        }

        private void label3_Click(object sender, EventArgs e)
        {
            FloderHelper.OpenFloder("https://acg12.com/category/others/acg-avatar/");

        }
    }
}
